#include<bits/stdc++.h>
using namespace std;

int n,cnt=1,ans;
int r[100005];
int num[100005],res[100005];

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)cin>>r[i];
    sort(r+1,r+1+n);
    num[1]=1;
    for (int i=2;i<=n;i++){
        if (r[i]==r[i-1]) num[cnt]++;
        else num[++cnt]++;
    }
    for(int i=1;i<cnt;i++){
        if(num[i]+res[i]<=num[i+1])res[i+1]=0;
        else res[i+1]=res[i]+num[i]-num[i+1];
    }
    res[cnt]+=num[cnt];
    cout<<res[cnt]<<endl;
    return 0;
}
